﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SkysunCreate : MonoBehaviour
{
    /// <summary>
    /// 阳光随机生成位置
    /// </summary>
    private float miny = 0;
    private float maxy = 7.2f;
    private float maxx = 13f;
    private float minx = 0f;
    private float creaty = 7.82f;
    void Start()
    {
        InvokeRepeating("Creatsun", 5, 5);
    }

    // Update is called once per frame
    void Update()
    {
    }
    void Creatsun()
    {
        GameObject sun = Instantiate(GameManager.instance.Gameconf.sunprefab);
        sun.GetComponent<Sun>().issky = true;
        sun.transform.SetParent(this.transform);
        sun.GetComponent<Sun>().Init(Random.Range(miny,maxy),Random.Range(minx,maxx),creaty);
    }
}
